import req from './request.js'
import params from './params.js'
import noti from "./notification.js"
export default{
	install(Vue){
		Vue.prototype.$req = req
		Vue.prototype.$params = params
		Vue.prototype.$noti = noti
		Vue.prototype.$formatTime = date => {
			const formatNumber = n => {
				n = n.toString()
				return n[1] ? n : `0${n}`
			}
			const year = date.getFullYear()
			const month = date.getMonth() + 1
			const day = date.getDate()
			const hour = date.getHours()
			const minutes = date.getMinutes()
			const seconds = date.getSeconds()
			return `${[year,month,day].map(formatNumber).join('-')} ${[hour,minutes,seconds].map(formatNumber).join(':')}`
		}
	}
}